<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class testaddWeek extends WebTestCase {

    function testaddWeekModule() {
        
        $this->get('http://localhost/index.php');
        $this->assertResponse(200);
        $this->setField('user', 'admin');
        $this->setField('pass', 'devproject');
        $this->click('Login');
        
        $this->get("http://localhost/addWeek.php");
        $this->assertResponse(200);
        $this->setField("month", "Dec");
        $this->setField("day", "31");
        $this->setField("year", "2014");
        $this->setField("weekday_group", "1");
        $this->setField("weekend_group", "1");
        $this->setField("family_room_group", "1");
        $this->click("Add new week");
        $this->assertResponse(200);
        $this->assertText("unpublished");
        $this->clickLink("publish");
        $this->assertText("published");
        $this->get("http://localhost/addWeek.php");
        $this->assertText("published");
        $this->clickLink("unpublish");
        $this->assertText("unpublished");
        $this->get("http://localhost/addWeek.php");
        $this->clickLink("remove");
        $this->assertText("removed");
        
        $this->get('http://localhost/logout.php');
        $this->assertResponse(200);  
        
        echo("testaddWeek complete");
    }
}
?>
